﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using Core.Queries;
using Core.Messages;

namespace Core.IRepository
{
    public interface IRepository<TId, TEntity>
    {
        void Add(TEntity entity);
        void Delete(TEntity entity);
        void Delete(Expression<Func<TEntity, bool>> predicate);
        void Edit(TEntity entity);

        TEntity FindBy(TId id);
        IList<TEntity> FindAll();
        IList<TEntity> FindBy(Expression<Func<TEntity, bool>> predicate);
        QueryResponse<TEntity> FindBy(Query<TEntity> query);
    }
}
